package com.heima.user.feign;

import com.heima.apis.user.IUserClient;
import com.heima.model.admin.dtos.AdminUserDto;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.user.service.AdminUserService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class AdminUserClient {


    @Autowired
    private AdminUserService adminUserService;


    @PostMapping("/api/v1/auth/appList")
    public ResponseResult findList(@RequestBody AdminUserDto dto) {
        return adminUserService.findList(dto);
    }


    @PostMapping("/api/v1/auth/authFail")
    public ResponseResult fail(@RequestBody AdminUserDto dto) {
        dto.setStatus(2);
        return adminUserService.successOrFail(dto);
    }


    @PostMapping("/api/v1/auth/authPass")
    public ResponseResult success(@RequestBody AdminUserDto dto) {
        dto.setStatus(9);
        return adminUserService.successOrFail(dto);
    }
}
